<template>
  <div>
    <div class="favorite-container">
      <!-- 封面 -->
      <div class="favorite-header my-animation-slide-top">
        <!-- 背景图片 -->
        <video class="index-video" autoplay="autoplay" muted="muted" loop="loop"
               :src="$store.state.sysConfig['webStaticResourcePrefix'] + 'assets/backgroundVideo.mp4'">
        </video>
        <div style="position: absolute;left: 0;top: 0;padding: 5px 20px">
          <!-- 标题 -->
          <div style="color: var(--white);margin: 0 10px">
            <div style="font-size: 30px;font-weight: bold;line-height: 2">
              这边写点什么。。
            </div>
          </div>
          <div class="card-container">
            <!-- 友人帐 -->
            <div @click="changeFavorite(3)"
                 class="card-item">
              <div class="favorite-image"></div>
              <div style="position: absolute;left: 0;top: 0;padding: 20px 25px 15px">
                <div class="card-name">
                  个人简介
                </div>
                <div class="card-desc">
                  。。。。。。
                </div>
              </div>
            </div>



          </div>
        </div>
      </div>

      <!-- 内容 -->
      <div class="favorite-content">


        <div class="my-animation-hideToShow">
          <el-row>
            <el-col :span="20">
              <p><b>豆瓣评分chrome插件</b></p>
              <a target="_blank" href="https://chromewebstore.google.com/detail/douban-faster/ddmlclnjlfpgfggngopcihpfhlamkafj?hl=zh-CN&utm_source=ext_sidebar" class="aHref">
              <p class="desFont">
                douban faster，一款chrome插件，主要用于不用打开新标签就能查询你剪贴板里的文字信息，将该文字作为电影名查询豆瓣评分。
              </p>
              </a>
            </el-col>
            <el-col :span="4">
              <el-image
                style="width: 80px; height: 80px; border-radius:50%"
                :src="chromeImgUrl"
                ></el-image>
            </el-col>
          </el-row>

          <el-row style="margin-top: 10px">
            <el-col :span="20" >
              <p><b>设备统计展示图</b></p>
              <a target="_blank" href="https://github.com/wadewtwt/vue-use-count" class="aHref">
                <p class="desFont">
                  一个使用vue的简单项目，一块用来展示设备使用热点图和温度&电量使用情况折线图，另一块是展示多个项目版本发布情况的历史图，欢迎点评！
                </p>
              </a>
            </el-col>
            <el-col :span="4">
              <el-image
                style="width: 80px; height: 80px; border-radius:50%"
                :src="githubImgUrl"
              ></el-image>
            </el-col>
          </el-row>


          <el-row style="margin-top: 10px">
            <el-col :span="20" >
              <p><b>拍照搜题小程序</b></p>
              <a href="#" class="aHref">
                <p class="desFont">
                  一款微信小程序项目，目前已运行四年，主要由我和一名前端开发，做到了小程序拍照题目照片上传后，后端OCR提取图片相关文字然后进行ES搜索，根据最优匹配原则展示最匹配的原题返回，担任主要负责人角色。
                </p>
              </a>
            </el-col>
            <el-col :span="4">
              <el-image
                style="width: 80px; height: 80px; border-radius:50%"
                :src="wechatImgUrl"
              ></el-image>
            </el-col>
          </el-row>
        </div>


      </div>
    </div>

    <!-- 页脚 -->
    <div style="background: var(--favoriteBg)">
      <myFooter></myFooter>
    </div>
  </div>
</template>

<script>

  const myFooter = () => import( "./common/myFooter");
  const funny = () => import( "./funny");
  const friend = () => import( "./friend");

  export default {
    components: {
      myFooter,
    },

    data() {
      return {
        card: null,
        collects: {},
        chromeImgUrl: "https://pub-1a8831fb5c2b4398894dc46c71d9594e.r2.dev/blog/chrome.jpg",
        githubImgUrl: "https://pub-1a8831fb5c2b4398894dc46c71d9594e.r2.dev/blog/GitHub.jpg",
        wechatImgUrl: "https://pub-1a8831fb5c2b4398894dc46c71d9594e.r2.dev/blog/R.png"
      }
    },

    computed: {},

    watch: {},

    created() {
      this.card = 3;
    },

    mounted() {

    },

    methods: {
      toUrl(url) {
        window.open(url);
      },
      changeFavorite(card) {
        if (card === 1) {
          if (this.$common.isEmpty(this.collects)) {
            this.getCollect(card);
          }
        }
        this.card = card;
      },
      getCollect() {
        this.$http.get(this.$constant.baseURL + "/webInfo/listCollect")
          .then((res) => {
            if (!this.$common.isEmpty(res.data)) {
              this.collects = res.data;
            }
          })
          .catch((error) => {
            this.$message({
              message: error.message,
              type: "error"
            });
          });
      }
    }
  }
</script>

<style scoped>

  .favorite-container {
    padding: 25px;
    background: var(--favoriteBg);
  }

  .favorite-header {
    margin: 60px auto 30px;
    height: 330px;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    max-width: 1200px;
  }

  .index-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .favorite-image::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--translucent);
  }

  .card-container {
    display: flex;
    flex-wrap: wrap;
    margin-top: 60px;
  }

  .card-item {
    transition: all 0.3s;
    position: relative;
    width: 250px;
    height: 120px;
    border-radius: 20px;
    animation: hideToShow 1s ease-in-out;
    cursor: pointer;
    overflow: hidden;
    margin: 10px;
    color: var(--white);
  }

  .card-item:hover {
    transform: translateY(-6px);
  }

  .card-name {
    font-weight: bold;
    font-size: 25px;
  }

  .card-name:after {
    top: 50px;
    width: 22px;
    left: 26px;
    height: 2px;
    background: var(--white);
    content: "";
    border-radius: 1px;
    position: absolute;
  }

  .card-desc {
    font-weight: bold;
    margin-top: 15px;
  }

  .favorite-content {
    margin: 0 auto;
    max-width: 1200px;
  }

  .collect-classify {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
  }

  .favorite-item-wrap {
    display: flex;
    flex-wrap: wrap;
    margin-left: -10px;
  }

  .favorite-item {
    transition: all 0.3s;
    border-radius: 12px;
    box-shadow: 0 8px 16px -4px #2c2d300c;
    background: var(--background);
    display: flex;
    width: calc(100% / 4 - 20px);
    max-width: 320px;
    height: 90px;
    overflow: hidden;
    padding: 15px;
    cursor: pointer;
    margin: 10px;
  }

  .favorite-item:hover {
    background: #425AEF;
    color: var(--white);
  }

  .favorite-item:hover .favorite-item-image {
    transition: all 0.6s;
    width: 0 !important;
    height: 0 !important;
    opacity: 0;
    margin-right: 0;
  }

  .favorite-item:hover div:nth-child(2) {
    width: 100% !important;
  }

  .favorite-item-image {
    margin-right: 20px;
    transition: all 0.3s;
  }

  .favorite-item-title {
    font-size: 19px;
    font-weight: bold;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    margin-bottom: 5px;
  }

  .favorite-item-introduction {
    opacity: 0.7;
    font-weight: bold;
    letter-spacing: 1px;
    font-size: 14px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  @media screen and (max-width: 906px) {
    .card-container {
      margin-top: 0;
    }
  }

  @media screen and (max-width: 906px) {
    .favorite-item {
      width: calc(100% / 3 - 20px);
    }

    .favorite-header {
      height: 360px;
    }
  }

  @media screen and (max-width: 636px) {
    .favorite-item {
      width: calc(100% / 2 - 20px);
    }

    .favorite-header {
      height: 500px;
    }
  }

  .aHref{
    text-decoration: none;
    color: #1d1f21;
  }
  .aHref :hover{
    color: #23a6d5;
  }

  .desFont {
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  @media screen and (max-width: 400px) {
    .favorite-item {
      width: calc(100% - 20px);
    }
  }
</style>
